<template>
  <a-locale-provider :locale="zhCN">
    <div id="app" style="min-height: 100%">
      <router-view/>
    </div>
  </a-locale-provider>
</template>
<script>
import Mock from '@/utils/mock.js'
import $ from 'jquery'
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import 'moment/locale/zh-cn'
import { mapActions } from 'vuex'
Mock()
export default {
  data () {
    return {
      zhCN
    }
  },
  methods: {
    ...mapActions(['ToggleMobile']),
    init() {
      let width = $(window).width()
      if (width <= 600) {
        this.ToggleMobile(true)
      } else {
        this.ToggleMobile(false)
      }
    }
  },
  mounted: function () {
    this.init()
    const _this = this
    window.onresize = function() {
      _this.init()
    }
  }
}
</script>
<style lang="scss">
</style>
